/**
 * @Date        : 2021/2/26
 * @Author      : sunxiangke(sunxiangke@baidu.com)
 * @Description :
 */

package main

import "fmt"

func main() {
	fmt.Println(findLengthOfLCIS([]int{1, 3, 5, 4, 7}))
}

func findLengthOfLCIS(nums []int) int {
	i, j := 0, 1
	maxLength := 0

	for ; j < len(nums); j++ {
		if nums[j] <= nums[j-1] {
			maxLength = max(maxLength, j-i)
			i = j
		}
	}

	return max(maxLength, j-i)
}

func max(a, b int) int {
	if a > b {
		return a
	} else {
		return b
	}
}
